/*
 * @Author: xuhanghai 2421880682@qq.com
 * @Date: 2024-12-10 09:23:40
 * @LastEditors: wuheng wuheng@szhbzc.com
 * @LastEditTime: 2025-02-20 09:53:30
 * @FilePath: \hbzc-groupmeal-center-web\src\main.ts
 */
import { createApp } from "vue";
import App from "./App.vue";
import router from "@/router";
// import '@/styles/variables.scss'
import { setupStore } from "@/store";
import { setupDirective } from "@/directive";
import { useUserStore } from "@/store/modules/user";
import { setupRouterHooks } from "@/permission";

const userStore = useUserStore();
import "@/permission";

// 本地SVG图标
import "virtual:svg-icons-register";

// 国际化
import i18n from "@/lang/index";

// 样式
// import "element-plus/theme-chalk/dark/css-vars.css";
import "@/styles/index.scss";
import "uno.css";

// 图片预览组件
// import Viewer from "v-viewer";
// import "viewerjs/dist/viewer.css";

const app = createApp(App);
// 全局注册 自定义指令(directive)
setupDirective(app);
// 全局注册 状态管理(store)
setupStore(app);


// 修改 await 打包异常问题
async function bootstrap() {
  await setupRouterHooks(); // 替换为你的实际函数
  app
    .use(router)
    .use(i18n)
    .mount("#app");
}
bootstrap()
